<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Report_cetak_kartu_ujian extends CI_Controller
{
	
	function __construct(){
		parent::__construct();
	}
	
	function index($id_siswa){
		$this->load->model("web/mod_general");
		$this->load->model("manual/mod_hasil");
		
		$segment_3 = $this->uri->segment(3); // Kelas
		$segment_4 = $this->uri->segment(4); // Tahun Ajaran
		$segment_5 = $this->uri->segment(5); // Semester
		
		$data["siswa"] 					= $this->mod_hasil->panggil_siswa_doang2($id_siswa,$segment_3,$segment_4,$segment_5);
		$data["saring"] 				= $this->mod_hasil->model_tampil_print($id_siswa,$segment_3,$segment_4,$segment_5);
		$data["ulang"] 					= $this->mod_hasil->siswa_mengulang($id_siswa,$segment_3,$segment_4,$segment_5);
		$data["tanggal"]				= $this->tgl_indo();
		
		$data['web_title']				= $this->mod_general->get_web_setting('web_title');
		$data['nama_sekolah']			= $this->mod_general->get_web_setting('front_title');
		$data['moto_sekolah']			= $this->mod_general->get_web_setting('moto_sekolah');
		$data['alamat_sekolah']			= $this->mod_general->get_web_setting('alamat_sekolah');
		$data['telp_sekolah']			= $this->mod_general->get_web_setting('telp_sekolah');
		$data['email']					= $this->mod_general->get_web_setting('email');
		$data['logo']					= $this->mod_general->get_web_setting('web_logo');

		$data['nama_ketua_kampus']		= $this->mod_general->get_web_setting('nama_ketua_kampus');
		$data['nip_ketua_kampus']		= $this->mod_general->get_web_setting('nip_ketua_kampus');
		$data['jabatan_ketua_kampus']	= $this->mod_general->get_web_setting('jabatan_ketua_kampus');
		
		
		$this->load->view("engine/manual/report_cetak_kartu_ujian", $data);		
	}	
	
	function tgl_indo(){
		// Menghitung hari
		date_default_timezone_set('Asia/Jakarta'); // PHP 6 mengharuskan penyebutan timezone
		
		//menentukan bulan dalam bahasa indonesia
		$library_sebulan = array("","Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");
		$library_angka_bulan = date("n");
		$library_bulan_ini = $library_sebulan[$library_angka_bulan];
		
		// untuk diupload ke database
		$library_kirim_tanggal = date("d")." ".$library_bulan_ini." ".date("Y");
		return $library_kirim_tanggal;
	}

}
?>